package com.liao.view;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private Button btn_clock;
    private Button btn_video;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
    }

    private void initView() {
        btn_clock = (Button) findViewById(R.id.btn_clock);
        btn_video = (Button) findViewById(R.id.btn_video);

        btn_clock.setOnClickListener(this);
        btn_video.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_clock:
                startActivity(new Intent(this, ClockActivity.class));
                break;
            case R.id.btn_video:
                startActivity(new Intent(this, VideoActivity.class));
                break;
        }
    }
}
